package com.agu.mgt.fsmsmgt.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.agu.utils.Query;

import java.util.List;
import java.util.Map;

import com.agu.mgt.fsmsmgt.dao.FsmsTemplateCanvasDao;
import com.agu.entity.fsmsmgt.FsmsTemplateCanvasEntity;
import com.agu.mgt.fsmsmgt.service.FsmsTemplateCanvasService;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;


@Service("fsmsTemplateCanvasService")
@Transactional(readOnly = true)
public class FsmsTemplateCanvasService{
	@Autowired
	private FsmsTemplateCanvasDao fsmsTemplateCanvasDao;
	
	
	public FsmsTemplateCanvasEntity queryObject(Integer canvasId){
		return fsmsTemplateCanvasDao.queryObject(canvasId);
	}
	
	
	public List<FsmsTemplateCanvasEntity> queryList(Map<String, Object> map){
		return fsmsTemplateCanvasDao.queryList(map);
	}

    
	public Page<FsmsTemplateCanvasEntity> queryPageList(Query query){
	    PageHelper.startPage(query.getPage(), query.getLimit());
	    return fsmsTemplateCanvasDao.queryPageList(query);
	}
	
	
	public int queryTotal(Map<String, Object> map){
		return fsmsTemplateCanvasDao.queryTotal(map);
	}
	
	
	@Transactional
	public void save(FsmsTemplateCanvasEntity fsmsTemplateCanvas){
		fsmsTemplateCanvasDao.save(fsmsTemplateCanvas);
	}
	
	
	@Transactional
	public void update(FsmsTemplateCanvasEntity fsmsTemplateCanvas){
		fsmsTemplateCanvasDao.update(fsmsTemplateCanvas);
	}
	
	
	@Transactional
	public void delete(Integer canvasId){
		fsmsTemplateCanvasDao.delete(canvasId);
	}
	
	
	@Transactional
	public void deleteBatch(Integer[] canvasIds){
		fsmsTemplateCanvasDao.deleteBatch(canvasIds);
	}
}
